﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ITProject.Domain.Entities;
using System.Web.Mvc;

namespace ITProject.WebUI.Models.ProjectAdmin
{
    public class ProjectAdminFunctionalRequirementViewModel
    {
        public string Name { get; set; }
        // parametr ukryty
        public int RequirementId { get; set; }

        public static ProjectAdminFunctionalRequirementViewModel[] Convert(FunctionalRequirement[] requirements)
        {
            ProjectAdminFunctionalRequirementViewModel[] vmTab = new ProjectAdminFunctionalRequirementViewModel[requirements.Length];
            for (int i = 0; i < requirements.Length; i++)
            {
                vmTab[i] = new ProjectAdminFunctionalRequirementViewModel();
                vmTab[i].Name = requirements[i].Name;
                vmTab[i].RequirementId = requirements[i].Id;
            }
            return vmTab;
        }
    }
}